<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<div class="well">
	<s:url namespace="/signcourse" action="signUp" id="signUp">
		<s:param name="id" value="#student.id" />
	</s:url>
	<a class="btn btn-primary" href="${signUp}">
		<i class="icon-plus icon-white"></i> 注册新课程
	</a>
	<s:url namespace="/orderlesson" action="orderAuditionLesson" id="orderAuditionLesson">
		<s:param name="studentId" value="#student.id" />
	</s:url>
	<a class="btn btn-primary" href="${orderAuditionLesson}">
		<i class="icon-edit icon-white"></i> 订试听课
	</a>
	<table class="table">
		<thead>
			<tr>
				<th>课程名称</th>
				<th>听课证号</th>
				<th>卡号</th>
				<th>期限</th>
				<th>开始时间</th>
				<th>结束时间</th>
				<th>次数</th>
				<th>状态</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="#student.courses" var="signCourse">
				<s:if test='learnStatus.toString()=="结课"'>
					<s:set name="cssClass" value="'error'"></s:set>
				</s:if>
				<s:elseif test='learnStatus.toString()=="冻结"'>
					<s:set name="cssClass" value="'warning'"></s:set>
				</s:elseif>
				<s:else>
					<s:set name="cssClass" value="'success'"></s:set>
				</s:else>
				<tr class="${cssClass}">
					<td>
						<div class="dropdown">
							<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
								${signCourse.course.name}<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><s:url id="orderLesson" action="orderLesson" namespace="/orderlesson">
										<s:param name="signCourseId" value="id"></s:param>
									</s:url> <a href="${orderLesson}">订课</a></li>
								<li><s:url id="orderHistoryLesson" action="orderHistoryLesson" namespace="/orderlesson">
										<s:param name="signCourseId" value="id"></s:param>
									</s:url> <a href="${orderHistoryLesson}">补订历史课程</a></li>

								<li><s:url id="extendSignCourse" action="extendSignCourse" namespace="/signcourse">
										<s:param name="signCourseId" value="id"></s:param>
									</s:url> <a href="${extendSignCourse}">延长课时</a></li>
								<li><s:url id="changeSignCourse" action="changeSignCourse" namespace="/signcourse">
										<s:param name="signCourseId" value="id"></s:param>
									</s:url> <a href="${changeSignCourse}">转课/退费</a></li>
								<li><s:url id="modifySignCourse" action="modifySignCourse" namespace="/signcourse">
										<s:param name="id" value="id"></s:param>
									</s:url> <a href="${modifySignCourse}">修改选课情况</a></li>
							</ul>
						</div>

					</td>
					<td>${signCourse.lessonCard}</td>
					<td>${signCourse.cardId}</td>
					<td>${signCourse.term}</td>
					<td><s:date name="beginTime" format="yyyy-MM-dd" /></td>
					<td><s:date name="endTime" format="yyyy-MM-dd" /></td>
					<td><s:if test="times == 0">无限期</s:if> <s:else>${signCourse.times}</s:else></td>
					<td><s:url namespace="/school" action="createFreezeLog" id="createFreezeLog">
							<s:param name="signId" value="id"></s:param>
							<s:param name="studentid" value="student.id"></s:param>
						</s:url> <s:url namespace="/school" action="doResumeCourse" id="resumeCourse">
							<s:param name="signId" value="id"></s:param>
							<s:param name="studentid" value="student.id"></s:param>
						</s:url> <s:url namespace="/school" action="doFinishCourse" id="finishCourse">
							<s:param name="signId" value="id"></s:param>
							<s:param name="studentid" value="student.id"></s:param>
						</s:url> <s:property value="learnStatus" /> <s:if test='!learnStatus.toString().equals("在读")'>
							<a class="confirm" href="${resumeCourse}" title="恢复课程">
								<i class="icon-play"></i>
							</a>
						</s:if> <s:else>
							<a class="frame" href="${createFreezeLog}" title="冻结课程">
								<i class="icon-pause"></i>
							</a>
						</s:else> <s:if test='!learnStatus.toString().equals("结课")'>
							<a class="confirm" href="${finishCourse}" title="结课">
								<i class="icon-stop"></i>
							</a>
						</s:if></td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
</div>